﻿using System.Collections.Generic;

namespace CommonEngine
{
    /// <summary>
    /// 返回数据打包
    /// </summary>
    public class ReturnData
    {
        /// <summary>
        /// 状态
        /// </summary>
        public bool Status { get; set; }

        /// <summary>
        /// 消息
        /// </summary>
        public string Message { get; set; }
    }

    /// <summary>
    /// 返回泛型类
    /// </summary>
    public class ReturnData<T> : ReturnData
    {
        /// <summary>
        /// 返回数据
        /// </summary>
        public T Data { get; set; }
    }

    /// <summary>
    /// 分页数据类
    /// </summary>
    public class ReturnPage<T> : ReturnData
    {
        /// <summary>
        /// 分页数据
        /// </summary>
        public PageData<T> Data { get; set; }
    }

    /// <summary>
    /// 分页数据类
    /// </summary>
    public class PageData<T>
    {
        /// <summary>
        /// 页面索引
        /// </summary>
        public int PageIndex { get; set; }
        /// <summary>
        /// 每页记录条数
        /// </summary>
        public int PageSize { get; set; }
        /// <summary>
        /// 总计数
        /// </summary>
        public int TotalCount { get; set; }
        /// <summary>
        /// 数据清单
        /// </summary>
        public IEnumerable<T> Result { get; set; }
    }
}
